<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="aa" uri="/WEB-INF/tld/ajaxanywhere.tld" %>
<%@ taglib prefix="datapager" uri="/WEB-INF/tld/pageTag.tld" %>
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>jsp</title>
<script src="/webjars/jquery/3.5.1/jquery.js"></script>
<script src="/aa.js"></script>

<link href="/page.css" type="text/css" rel="stylesheet">
<%--<link rel="stylesheet" href="/resources/css/bootstrap.min.css" />
<link rel="stylesheet" href="/resources/css/dashboard.css" />--%>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" >
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" ></script>


</head>
<body>

	<h1>${msg}</h1>
	<br />
	<%--<button type="button" name="btQuery" id="btQuery">查询列表</button>--%>



	<div class="mb-3 row">
		<label for="staticEmail" class="col-sm-2 col-form-label">ID</label>
		<div class="col-sm-10">
			<input type="text" readonly class="form-control-plaintext" id="id" value="1">
		</div>
	</div>
	<div class="mb-3 row">
		<label for="name" class="col-sm-2 col-form-label">姓名</label>
		<div class="col-sm-10">
			<input type="text" class="form-control" id="name" value="zzz">
		</div>
	</div>
	<%--<button type="button" name="btSave" class="btn btn-success" id="btSave">保存</button>
	<button type="button" name="btDelete" class="btn btn-danger" id="btDelete">删除</button>
	<button type="button" name="btSaveBath" class="btn btn-warning" id="btSaveBath">批量保存</button>
	<button type="button" name="btDto" class="btn btn-primary" id="btDto">复杂保存</button>--%>

	<%--<form name="searchFrom" id="searchFrom"></form>--%>
	<aa:zone name="zoneJ">
		<ul>
			<c:forEach var="o" items="${page.pageList}" varStatus="s">
				<li>
					<input type="checkbox" class="ck_id" value="${o.id}" data-id="${o.id}" />
						${s.count} , id: ${o.id} , name: ${o.name} ,createDate: ${o.createDate}
				</li>
			</c:forEach>
		</ul>

			<datapager:page pageNo="${page.pageNo}" total="${page.total}" totalPage="${page.totalPage}" />
	</aa:zone>

</body>
<%--<script type="text/javascript">
	function getVo(){
		let vo={}
		vo.id=$("#id").val()
		vo.name=$("#name").val()
		return vo
	}
	$('#btSave').on('click',function(){
		let vo=getVo()
		$.post("/save/demo",vo).then(s=>{
			console.log(s)
		})
	})

	$('#btDelete').on('click',function(){
        let data=getDeleteData()
		$.post("/demo/deleteByIds",data).then(s=>{
			console.log(s)
		})
	})

	function getDeleteData(){
		let arr=[]
		$.each($(".ck_id:checked"),function(i,v){
			arr.push(v)
		})
		return arr
	}

	$('#btSaveBath').on('click',function(){
		let data=getSaveBathData()
		$.ajax({
			url:"/demo/saveBath",
			type:'post',
			data:JSON.stringify(data),
			contentType:'application/json',
			success:function(data){
				alert(data)
			}
		})

	})
	function getSaveBathData(){
		let arr=[{id:'1',name:'ccc'},{id:'2',name:'ddd'}]
        return arr
	}

</script>--%>
<script src="/page.js"></script>
</html>
